This is adding functions for the remaining render nodes.
gtk_snapshot_append_texture
gtk_snapshot_append_color
gtk_snapshot_append_layout
+gtk_snapshot_append_linear_gradient
+gtk_snapshot_append_repeating_linear_gradient
+gtk_snapshot_append_border
gtk_snapshot_render_background
gtk_snapshot_render_frame
gtk_snapshot_render_focus
/**
* gsk_border_node_new:
* @outline: a #GskRoundedRect describing the outline of the border
- * @border_width: the stroke width of the border on the top, right, bottom and
- * left side respectively.
- * @border_color: the color used on the top, right, bottom and left side.
+ * @border_width: (array fixed-size=4): the stroke width of the border on
+ * the top, right, bottom and left side respectively.
+ * @border_color: (array fixed-size=4): the color used on the top, right,
+ * bottom and left side.
*
* Creates a #GskRenderNode that will stroke a border rectangle inside the
* given @outline. The 4 sides of the border can have different widths and
const GdkRGBA colors[4],
guint hidden_side)
{
- GskRoundedRect offset_outline;
- GskRenderNode *node;
- int off_x, off_y;
-
if (hidden_side)
{
GdkRGBA real_colors[4];
return;
}
- gtk_snapshot_get_offset (snapshot, &off_x, &off_y);
- gsk_rounded_rect_init_copy (&offset_outline, outline);
- gsk_rounded_rect_offset (&offset_outline, off_x, off_y);
-
- node = gsk_border_node_new (&offset_outline, border_width, colors);
- gtk_snapshot_append_node_internal (snapshot, node);
- gsk_render_node_unref (node);
+ gtk_snapshot_append_border (snapshot, outline, border_width, colors);
}
static void
gtk_snapshot_append_node_internal (snapshot, node);
gsk_render_node_unref (node);
}
+
+/**
+ * gtk_snapshot_append_border:
+ * @snapshot: a #GtkSnapshot
+ * @outline: a #GskRoundedRect describing the outline of the border
+ * @border_width: (array fixed-size=4): the stroke width of the border on
+ * the top, right, bottom and left side respectively.
+ * @border_color: (array fixed-size=4): the color used on the top, right,
+ * bottom and left side.
+ *
+ * Appends a stroked border rectangle inside the given @outline. The
+ * 4 sides of the border can have different widths and colors.
+ **/
+void
+gtk_snapshot_append_border (GtkSnapshot *snapshot,
+ const GskRoundedRect *outline,
+ const float border_width[4],
+ const GdkRGBA border_color[4])
+{
+ GskRenderNode *node;
+ GskRoundedRect real_outline;
+ float scale_x, scale_y, dx, dy;
+
+ g_return_if_fail (snapshot != NULL);
+ g_return_if_fail (outline != NULL);
+ g_return_if_fail (border_width != NULL);
+ g_return_if_fail (border_color != NULL);
+
+ gtk_snapshot_ensure_affine (snapshot, &scale_x, &scale_y, &dx, &dy);
+ gtk_rounded_rect_scale_affine (&real_outline, outline, scale_x, scale_y, dx, dy);
+
+ node = gsk_border_node_new (&real_outline, border_width, border_color);
+
+ gtk_snapshot_append_node_internal (snapshot, node);
+ gsk_render_node_unref (node);
+}
const graphene_point_t *end_point,
const GskColorStop *stops,
gsize n_stops);
+GDK_AVAILABLE_IN_ALL
+void gtk_snapshot_append_border (GtkSnapshot *snapshot,
+ const GskRoundedRect *outline,
+ const float border_width[4],
+ const GdkRGBA border_color[4]);
/* next function implemented in gskpango.c */
GDK_AVAILABLE_IN_ALL
void gtk_snapshot_append_layout (GtkSnapshot *snapshot,